<#include "../common/frontlayout.ftl"/>
<@html title_="${blog.title}" js_=['/lifes/blog_view.js']>
<div class="article-section-wrap">
    <input type="hidden" id="blogId" value="${blog.id}"/>
    <div class="article-section">
        <div class="container" style="padding-left: 4px;padding-right: 4px">
            <div class="nrtj-wrap"></div>
            <div class="wrap-left pull-left">
                <!--文章内容页-->
                <div class="article-wrap" style="padding-left: 0">
                    <h1 class="t-h1">${blog.title}</h1>
                    <div class="article-author">
                        <span class="author-name"><a href="/u/${user.username}" target="_blank">${user.nickname!user.username}</a></span>
                        <div class="column-link-box">
                            <span class="article-time pull-left"></span>
                            <span class="article-share pull-left">阅读<c id="readCount">0</c></span>
                            <span class="article-share pull-left">收藏<c id="collectCount">0</c></span>
                            <span class="article-share pull-left">点赞<c id="praiseCount">0</c></span>
                            <#if blogTypes?? && blog?? && blog.blogTypeId??>
                                 <#list blog.blogTypeId?split(",") as type>
                                    <a href="#" class="column-link" target="_blank">${blogTypes[type]}</a> <i></i>
                                 </#list>
                            </#if>
                        </div>
                    </div>
                    <!--文章头图-->
                    <#if blog.banner??>
                        <div class="article-img-box">
                            <img src="${blog.banner}">
                        </div>
                    </#if>

                    <div  class="article-content-wrap">
                        ${blogExt.content}
                    </div>

                    <br>
                    <a onclick="blog_praise(${blog.id})">
                        <div class="praise-box transition js-like-article-zan pull-right <#if praiseDetail??>praise-box-active</#if>" data-type="like">
                            <i class="icon icon-article-zan"></i><span class="num" id="praiseCountNum">0</span>
                        </div>
                    </a>
                    <div class="praise-box transition pull-right" style="width: 20px;"></div>
                    <a onclick="blog_collect(${blog.id})">
                        <div class="praise-box transition js-like-article-collect pull-right <#if collectDetail??>collect-box-active</#if>" data-type="like">
                            <i class="icon icon-article-collect"></i><span class="num" id="collectCountNum">0</span>
                        </div>
                    </a>




                    <!--公共评论-->
                    <div class="pl-wrap"  name="pl-wrap-article">
                        <div class="pl-form-wrap">
                            <span class="span-mark-author active">发表评论</span>
                            <div class="pl-form-box pl-article-wrap">
                                <textarea class="form-control " name="saytext" placeholder="请文明评论~"></textarea>
                                <!--普通文章评论发表-->
                                <button class="btn btn-article js-login transition " onclick="addBlogComment(this,${blog.id})">发表</button>
                            </div>
                        </div>
                        <div name="pl-wrap"></div>
                        <div class="pl-list-wrap">

                            <div class="pl-loading hide"><img src="${root}/images/lifes/loading.gif"></div>

                            <a href="javascript:void(0)" class="span-mark-author active js-default-new-pl" data-type="agree">默认评论</a>
                            <i class="icon icon-line-pl"></i>
                            <a href="javascript:void(0)" class="span-mark-author new js-default-new-pl" data-type="dateline">最新评论</a>

                            <div id="commentsListBody"></div>
                        </div>
                    </div>
                    <!--相关文章位置-->
                    <div id="related-article-wrap197460"></div>
                </div>
            </div>

            <div class="wrap-right pull-right">

                <div class="box-author-info">
                    <div class="author-face">
                        <a href="#" target="_blank">
                            <img src="${user.headimg}">
                        </a>
                    </div>
                    <div class="author-name">
                        <a href="/u/${user.username}" target="_blank">${user.nickname!user.username}</a>
                        <a href="#" target="_blank"><i class="i-vip icon-vip" title="青铜三"></i></a>
                        <i class="i-icon icon-auth3" title="实力OB"></i>
                    </div>
                    <div class="author-one">${user.selfInfo!''}</div>
                    <div class="author-one">lol</div>
                    <div class="author-article-pl">
                        <ul>
                            <li><a href="/u/${user.username}" target="_blank">${blogCount!0}篇文章</a></li>
                        </ul>
                    </div>
                    <#if lastBlog??>
                         <div class="author-next-article">
                             <div class="author-one c2">最近文章</div>
                             <a href="/blog/${lastBlog.blogId}">${lastBlog.blogTitle}</a>
                         </div>
                    </#if>
                </div>

                <div class="box-moder hot-tag">
                    <h3>热门标签</h3>
                    <span class="span-mark"></span>
                    <br>
                    <div class="search-history search-hot" style="margin: 0">
                        <ul>
                            <#if blogTypes??>
                                 <#list blogTypes?keys as key>
                                    <li class="transition" style="margin: 0"><a href="#" target="_blank">${blogTypes[key]}</a></li>
                                 </#list>
                            </#if>

                        </ul>
                    </div>
                </div>


                <div class="placeholder"></div>
                <form id="fiveBlogHotForm" action="${root}/blog/hot" method="get">
                    <input type="hidden" name="blogId" value="${blog.id}"/>
                </form>
                <div class="box-moder hot-article">
                    <h3>热文</h3>
                    <span class="span-mark"></span>
                    <ul id="fiveBlogListDataBody">

                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="article-section article-section-last"></div>
</div>

<script id="fiveBlogDataListTpl" type="text/html">
    {{#  if(d.list!=null&&d.list.length> 0){ }}
    {{#  layui.each(d.list, function(index, item){ }}
    <li>
        <div class="hot-article-img">
            <a href="/blog/{{item.blogId}}">
                <img src="{{item.blogBanner}}?imageView2/1/w/220/h/165"></a>
        </div>
        <a href="/blog/{{item.blogId}}" class="transition">{{item.blogTitle}}</a>
    </li>
    {{#  }); }}
    {{#} else { }}
    {{# }}}

</script>
</@html>

